package com.yiyahui.project.erp.service.impl;

import java.util.List;
import com.yiyahui.common.utils.DateUtils;
import com.yiyahui.project.erp.domain.requestVo.YiyaItemBillingExtend;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.yiyahui.project.erp.mapper.YiyaItemBillingMapper;
import com.yiyahui.project.erp.domain.YiyaItemBilling;
import com.yiyahui.project.erp.service.IYiyaItemBillingService;

/**
 * 开单项目Service业务层处理
 * 
 * @author yiyahui
 * @date 2020-06-10
 */
@Service
public class YiyaItemBillingServiceImpl implements IYiyaItemBillingService 
{
    @Autowired
    private YiyaItemBillingMapper yiyaItemBillingMapper;

    /**
     * 查询开单项目
     * 
     * @param id 开单项目ID
     * @return 开单项目
     */
    @Override
    public YiyaItemBilling selectYiyaItemBillingById(Long id)
    {
        return yiyaItemBillingMapper.selectYiyaItemBillingById(id);
    }

    /**
     * 查询开单项目列表
     * 
     * @param yiyaItemBilling 开单项目
     * @return 开单项目
     */
    @Override
    public List<YiyaItemBilling> selectYiyaItemBillingList(YiyaItemBilling yiyaItemBilling)
    {
        return yiyaItemBillingMapper.selectYiyaItemBillingList(yiyaItemBilling);
    }

    /**
     * 新增开单项目
     * 
     * @param yiyaItemBilling 开单项目
     * @return 结果
     */
    @Override
    public int insertYiyaItemBilling(YiyaItemBilling yiyaItemBilling)
    {
        yiyaItemBilling.setCreateTime(DateUtils.getNowDate());
        return yiyaItemBillingMapper.insertYiyaItemBilling(yiyaItemBilling);
    }

    /**
     * 修改开单项目
     * 
     * @param yiyaItemBilling 开单项目
     * @return 结果
     */
    @Override
    public int updateYiyaItemBilling(YiyaItemBilling yiyaItemBilling)
    {
        yiyaItemBilling.setUpdateTime(DateUtils.getNowDate());
        return yiyaItemBillingMapper.updateYiyaItemBilling(yiyaItemBilling);
    }

    /**
     * 批量删除开单项目
     * 
     * @param ids 需要删除的开单项目ID
     * @return 结果
     */
    @Override
    public int deleteYiyaItemBillingByIds(Long[] ids)
    {
        return yiyaItemBillingMapper.deleteYiyaItemBillingByIds(ids);
    }

    /**
     * 删除开单项目信息
     * 
     * @param id 开单项目ID
     * @return 结果
     */
    @Override
    public int deleteYiyaItemBillingById(Long id)
    {
        return yiyaItemBillingMapper.deleteYiyaItemBillingById(id);
    }

    @Override
    public List<YiyaItemBillingExtend> selectByItemBillingIds(List<Long> itemBillingIds) {
        return yiyaItemBillingMapper.selectByItemBillingIds(itemBillingIds);
    }

    @Override
    public List<YiyaItemBillingExtend> selectByBillingMainIds(List<Long> billingMainIds) {
        return yiyaItemBillingMapper.selectByBillingMainIds(billingMainIds);
    }

    @Override
    public void deleteByIds(List<Long> ids) {
        yiyaItemBillingMapper.deleteByIds(ids);
    }
}
